#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import win32com_accessdb as msaccess

def main():
    accessdb = msaccess.AccessDb()
    #access 2007
    mdbfile='c:/temp/ts.accdb'
    uname=''
    upwd=''
    mdwfile=mdbfile
    connAccess = accessdb.connect(mdbfile, uname, upwd, mdwfile)

    SQL_statement = "SELECT * FROM mytable"
    rs = accessdb.getRecordset(connAccess, SQL_statement)
    fields = rs.getFields()
    print fields

    for item in rs:
        print item

    connAccess.Close()


if __name__ == '__main__':
    main()
